# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=gwenhywfar
pkgver=5.10.2
pkgrel=0
pkgdesc="Multi-platform helper library"
url="https://www.aquamaniac.de/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="libgcrypt-dev gnutls-dev gettext-dev"
options="net" # tests send HTTP requests to remote hosts
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://www.aquamaniac.de/rdm/attachments/download/501/gwenhywfar-$pkgver.tar.gz
	fix-tests.patch"

case "$CARCH" in
arm*|aarch64)
	# these tests seem to require ipv4 networking
	options="$options !check"
	;;
esac

build() {
	export LDFLAGS="$LDFLAGS -lintl"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-guis= \
		--enable-ssl \
		--enable-visibility
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -m644 AUTHORS ChangeLog README TODO \
		"$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
d7e414fbf5762dbbb5664d56110d2b41fb693de93b52757ded8b2b883faa73d8d81c1ea033872b7b7928c2849a7373a344613321a8689cc51a8e533cc805f0bf  gwenhywfar-5.10.2.tar.gz
337836a5b6edf1f127768b1654d2e0667d8adc8e02f09a9d7bf0850ecee5fbe2ae544eb6a37436f57708b80c0b919d19f538fda30232ff3ac7c46e448a9adda6  fix-tests.patch
"
